﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _005_Action委托
{
    class Program
    {
        static void Main(string[] args)
        {
            // 创建实例
            Action<int> method = delegate(int i) { Console.WriteLine($"这里是使用delegate的委托，参数值是：{i}"); };
            Action<int> methon1 = (int a) => { Console.WriteLine($"这里是使用匿名委托，参数值是:{a}"); };
            // 执行
            method(12);
            methon1(52);
            

            Func<int,string> method2 = delegate(int i) { return i.ToString() + "转换";};
            string s = method2(535);
            Console.WriteLine(method2(535));
            Func<string> method3 = () => { return "匿名委托";};
            Console.WriteLine(method3());
            Console.ReadKey();


            List<int> list = new List<int>();
            
        }
    }
}
